package com.doge.walknovel.utils

import android.content.Context
import androidx.fragment.app.Fragment
import com.hjq.permissions.XXPermissions


fun Context.requirePermission(permissions: List<String>, callback: () -> Unit) {
    XXPermissions.with(this)
        .permission(permissions)
        .request { _, all ->
            if (all) callback()
        }
}

fun Fragment.requirePermission(permissions: List<String>, callback: () -> Unit) {
    XXPermissions.with(this)
        .permission(permissions)
        .request { _, all ->
            if (all) callback()
        }
}


